package com.demo.decry;
import org.junit.jupiter.api.Test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;

public class Decry {



    @Autowired
    private PasswordEncoder passwordEncoder;

    @Test
    public  void password(){

        String password = "123456789";
//        加密
        String encode = passwordEncoder.encode(password);
        System.out.println(encode);
//        解密
        boolean matches = passwordEncoder.matches(password, encode);
        System.out.println(matches);
    }



}
